package cn.mifengkong.appcommon.liveness;


import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.view.View;

import com.mifengkong.frtools.http.request.callback.BaseImpl;

/**
 * Created by jiangyongxing on 2018/5/4.
 * 描述：
 */

public interface ILivenessHelper {

    String LIVENESSACTIVITYSUCCESSTAG = "liveness_activity_success_return_tag";//活体检测成功返回的标识

    /**
     * 创建一个重试的dialog
     *
     * @param message
     * @return
     */
    AlertDialog createRetryDialog(String message);

    /**
     * 开启活体检测Activity
     *
     * @param requestCodeLivenessactivity
     * @param targe
     * @param colorN
     * @param colorP
     * @return
     */
    boolean startLivenessActivity(int requestCodeLivenessactivity, View targe, int colorN, int colorP);

    /**
     * 权限申请
     *
     * @param requestCode
     * @param permissions
     * @param grantResults
     */
    void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults);

    /**
     * 返回结果
     *
     * @param requestCode
     * @param resultCode
     * @param data
     * @param requestCodeLivenessactivity
     * @param livenesResultListener
     */
    void onActivityResult(int requestCode, int resultCode, Intent data, int requestCodeLivenessactivity, LivenessResultListener livenesResultListener);

    /**
     * 正式开启活体检测页面
     *
     * @param requestCode
     */
    void startActivity(int requestCode);

    /**
     * 保存用户活体检测以后的数据
     *  @param baseImpl
     * @param livenessDataBean
     * @param isForWebViewAndReloadUrl
     */
    void saveLivenessData(BaseImpl baseImpl, LivenessDataBean livenessDataBean, boolean isForWebViewAndReloadUrl);

}
